////#include <iostream>
////using namespace std;
////int day[] = { 0,31,29,31,30,31,30,31,31,30,31,30,31 };
////int main()
////{
////	int t;
////	int k;
////	int count = 0;
////	int x, y;
////	cin >> x >> y;
////	for (int i = 1;i <= 12;i++)
////	{
////		for (int j = 1;j <= day[i];j++)
////		{
////			t = j % 10 * 1000 + j / 10 * 100 + i % 10*10 + i / 10;
////			k = t * 10000 + i * 100 + j;
////			if (k >= x && k <= y)count++;
////		}
////		
////	}
////	cout << count;
////	return 0;
////}
//#include <iostream>
//#include <string>
//#include <algorithm>
//using namespace std;
//bool isleapyear(int a)
//{
//	return (a % 4 == 0 && a % 100 != 0) || a % 400 == 0;
//}
//bool isday(int y, int m, int d)
//{
//	if (d < 1 || d>31)return false;
//	if (m < 1 || m>12)return false;
//	if (m == 2)
//	{
//		if (isleapyear(y))
//			return d <= 29;
//		else return d <= 28;
//	}
//	if (m == 4 || m == 6 || m == 9 || m == 11)return d <= 30;
//	return true;
//}
//bool isrep(int x)
//{
//	string s = to_string(x);
//	string t = s;
//	reverse(t.begin(), t.end());
//	return s == t;
//}
//int main()
//{
//	int x, y;
//	cin >> x >> y;
//	int count = 0;
//	int a, b, c;
//	for (int i = x;i <= y;i++)
//	{
//		a = i / 10000;
//		b = i / 100 % 100;
//		c = i % 100;
//		if (isday(a, b, c))
//		{
//			if (isrep(i))
//				count++;
//		}
//	}
//	cout << count;
//}